package ace.module.account.api.model.auth.input;

import ace.module.account.api.model.auth.AuthenticationGrantType;
import ace.module.account.api.model.auth.input.params.AuthenticationParamsMap;
import jakarta.annotation.Nullable;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author caspar
 * @date 2023/10/23 15:07
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AuthenticationInputMap implements GenericAuthenticationInput<AuthenticationParamsMap> {

  /**
   * 客户端id
   */
  @NotEmpty
  private String idOfClient;

  /**
   * 认证方法
   * {@link AuthenticationGrantType#getCode()}
   */
  @NotEmpty
  private String grantType;

  /**
   * 账户应用id
   */
  @NotNull
  private Long iamAppId;

  /**
   * 账户标签,可选
   */
  @Nullable
  private String tag;

  /**
   * 认证参数
   */
  @Valid
  @NotNull
  private AuthenticationParamsMap bizParams;

  /**
   * 扩展参数
   */
  private Map<String, Object> additionalParameters;
}
